home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / varie / uae-0_64.lha / uae-0.6.4 / configure.in < prev    next >
Text File  |  1996-09-03  |  7KB  |  256 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2.  
  3. AC_INIT(amiga/source/transdisk.c)
  4. AC_PREREQ(2.10)
  5. dnl Checks for programs.
  6. AC_PROG_CC
  7.  
  8. AC_PROG_CPP
  9. AC_PROG_MAKE_SET
  10.  
  11. AC_AIX
  12. AC_ISC_POSIX
  13.  
  14. dnl Checks for libraries.
  15. HAVE_BEBOX=n
  16. dnl Replace `main' with a function in -lMedia_s: (Ian!)
  17. AC_CHECK_LIB(Media_s, main, HAVE_MEDIA_LIB=y, HAVE_MEDIA_LIB=n)
  18. dnl Replace `main' with a function in -lNeXT_s:
  19. AC_CHECK_LIB(NeXT_s, main, HAVE_NEXT_LIB=y, HAVE_NEXT_LIB=n)
  20. AC_CHECK_LIB(vga, vga_setmode, HAVE_SVGA_LIB=y, HAVE_SVGA_LIB=n)
  21. AC_CHECK_LIB(AF, AFOpenAudioConn, HAVE_AF_LIB=y, HAVE_AF_LIB=n)
  22.  
  23. AC_PATH_XTRA
  24. AC_CONFIG_HEADER(src/include/sysconfig.h)
  25.  
  26. AC_HEADER_DIRENT
  27. AC_HEADER_STDC
  28. AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/types.h utime.h string.h strings.h values.h)
  29. AC_CHECK_HEADERS(sys/vfs.h sys/mount.h sys/select.h sys/param.h sys/statfs.h sys/statvfs.h sys/stat.h linux/joystick.h)
  30.  
  31. if [[ $ac_cv_header_linux_joystick_h = "yes" ]]; then
  32.   AC_MSG_CHECKING(whether linux/joystick.h is broken)
  33.   if grep "#include" /usr/include/linux/joystick.h >/dev/null; then
  34.     AC_MSG_RESULT(yes)
  35.     BROKEN_JOYSTICK_H=1
  36.     grep -v "#include" /usr/include/linux/joystick.h >include/joystick.h
  37.   else
  38.     AC_MSG_RESULT(no)
  39.     BROKEN_JOYSTICK_H=0
  40.   fi
  41. fi
  42.  
  43. AC_CHECK_SIZEOF(char)
  44. AC_CHECK_SIZEOF(short)
  45. AC_CHECK_SIZEOF(int)
  46. AC_CHECK_SIZEOF(long)
  47. AC_CHECK_SIZEOF(long long)
  48.  
  49. dnl Checks for typedefs, structures, and compiler characteristics.
  50. AC_C_CONST
  51. AC_C_INLINE
  52. AC_TYPE_MODE_T
  53. AC_TYPE_OFF_T
  54. AC_TYPE_PID_T
  55. AC_STRUCT_ST_BLOCKS
  56. AC_HEADER_TIME
  57. AC_STRUCT_TM
  58.  
  59. dnl Checks for library functions.
  60. AC_PROG_GCC_TRADITIONAL
  61. AC_FUNC_MEMCMP
  62. AC_TYPE_SIGNAL
  63. AC_FUNC_UTIME_NULL
  64. AC_CHECK_FUNCS(gettimeofday mkdir rmdir select strerror strstr statfs)
  65.  
  66. AC_MSG_CHECKING(how many args statfs takes)
  67. if [[ $ac_cv_func_statfs = "yes" ]]; then
  68.   AC_TRY_COMPILE([
  69. #include "confdefs.h"
  70. #ifdef HAVE_SYS_TYPES_H
  71. #include <sys/types.h>
  72. #endif
  73. #ifdef HAVE_SYS_PARAM_H
  74. #include <sys/param.h>
  75. #endif
  76. #ifdef HAVE_SYS_MOUNT_H
  77. #include <sys/mount.h>
  78. #endif
  79. #ifdef HAVE_SYS_SELECT_H
  80. #include <sys/select.h>
  81. #endif
  82. #ifdef HAVE_SYS_VFS_H
  83. #include <sys/vfs.h>
  84. #endif
  85. #ifdef HAVE_SYS_STATFS_H
  86. #include <sys/statfs.h>
  87. #endif
  88. #ifdef HAVE_SYS_STATVFS_H
  89. #include <sys/statvfs.h>
  90. #endif],[struct statfs statbuf;statfs("/",&statbuf);],
  91. AC_MSG_RESULT(2) 
  92. STATFS_NO_ARGS=2,
  93. AC_MSG_RESULT(4)
  94. STATFS_NO_ARGS=4)
  95. fi
  96.  
  97. AC_MSG_CHECKING(whether to use f_bavail or f_bfree)
  98. if [[ $ac_cv_func_statfs = "yes" ]]; then
  99.   AC_TRY_COMPILE([
  100. #include "confdefs.h"
  101. #ifdef HAVE_SYS_TYPES_H
  102. #include <sys/types.h>
  103. #endif
  104. #ifdef HAVE_SYS_PARAM_H
  105. #include <sys/param.h>
  106. #endif
  107. #ifdef HAVE_SYS_MOUNT_H
  108. #include <sys/mount.h>
  109. #endif
  110. #ifdef HAVE_SYS_SELECT_H
  111. #include <sys/select.h>
  112. #endif
  113. #ifdef HAVE_SYS_VFS_H
  114. #include <sys/vfs.h>
  115. #endif
  116. #ifdef HAVE_SYS_STATFS_H
  117. #include <sys/statfs.h>
  118. #endif
  119. #ifdef HAVE_SYS_STATVFS_H
  120. #include <sys/statvfs.h>
  121. #endif],[struct statfs statbuf;statbuf.f_bavail;],
  122. AC_MSG_RESULT(f_bavail) 
  123. STATBUF_BAVAIL=f_bavail,
  124. AC_MSG_RESULT(f_bfree)
  125. STATBUF_BAVAIL=f_bfree)
  126. fi
  127.  
  128. USE_GUI=yes
  129. AC_ARG_ENABLE(gui, --disable-gui      Don't use the Tcl/Tk GUI,[USE_GUI=$enableval],[])
  130. if [[ $USE_GUI = "yes" ]]; then
  131.   AC_CHECK_PROG(USE_GUI,wish4.0,yes,no)
  132. else
  133.   echo "Disabling the GUI."
  134. fi
  135.  
  136. AC_MSG_CHECKING(which target to use)
  137. if [[ $HAVE_BEBOX = "y" ]]; then
  138.   AC_MSG_RESULT(BeBox)
  139.   TARGET=be
  140.   GFXOBJS="bebox.o nogui.o"
  141.   ac_cv_c_inline=
  142. else
  143.   if [[ $HAVE_NEXT_LIB = "y" ]]; then
  144.     AC_MSG_RESULT(NeXTStep)
  145.     TARGET=next
  146.     GFXOBJS="NeXTwin.o"
  147.     LIBRARIES="-sectcreate __ICON __header Uae.app/Uae.iconheader -segprot __ICON r r -sectcreate __ICON app Uae.app/Uae.tiff -lMedia_s -lNeXT_s"
  148.   else
  149.     if [[ x$no_x = "xyes" ]]; then
  150.       if [[ $HAVE_SVGA_LIB = "n" ]]; then
  151.         AC_MSG_RESULT(Ummm....)
  152.         echo "Neither X nor SVGAlib found, don't know what target to use."
  153.     exit 1
  154.       else
  155.         AC_MSG_RESULT(SVGAlib)
  156.         TARGET=svgalib
  157.     AC_CHECK_LIB(ncurses, waddch, , HAVE_GUI=no)
  158.     if [[ $USE_GUI = "yes" ]]; then
  159.       GFXOBJS="svga.o tui.o svgancui.o"
  160.       LIBRARIES="-lvga -lncurses"
  161.     else
  162.       GFXOBJS="svga.o nogui.o"
  163.       LIBRARIES="-lvga"
  164.     fi
  165.       fi
  166.     else
  167.       AC_MSG_RESULT(X Window System)
  168.       TARGET=x11
  169.       USEDGA=no
  170.       AC_ARG_ENABLE(DGA, --disable-DGA      Don't use the DGA extension,[USEDGA=$enableval],[])
  171.       if [[ $USEDGA = "yes" ]]; then
  172.         TMP_SAVE_LIBS=$LIBS
  173.         LIBS=$X_LIBS $LIBS
  174.         AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, USEDGA=yes, USEDGA=no, [-lXext -lX11])
  175.         LIBS=$TMP_SAVE_LIBS
  176.       fi
  177.       if [[ $USEDGA = "yes" ]]; then
  178.         LIBRARIES="$X_LIBS $X_PRE_LIBS -lXxf86dga -lXext -lX11 $X_EXTRA_LIBS"
  179.     X_CFLAGS="$X_CFLAGS -DUSE_DGA_EXTENSION"
  180.     USE_GUI=no
  181.       else
  182.         LIBRARIES="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
  183.     USE_GUI=yes
  184.       fi
  185.       if [[ $USE_GUI = "yes" ]]; then
  186.         GFXOBJS="xwin.o xui.o"
  187.       else
  188.         if [[ $USEDGA = "yes" ]]; then
  189.           GFXOBJS="xdga.o nogui.o"
  190.     else
  191.           GFXOBJS="xwin.o nogui.o"
  192.     fi
  193.       fi
  194.     fi
  195.   fi
  196. fi
  197.  
  198. ASMOBJS=
  199. CPUOBJS="cpu0.o cpu1.o cpu2.o cpu3.o cpu4.o cpu5.o cpu6.o cpu7.o cpu8.o cpu9.o cpuA.o cpuB.o cpuC.o cpuD.o cpuE.o cpuF.o"
  200.  
  201. dnl It may be possible to use X86.S on other systems, too, but then again, it
  202. dnl might break. Check for a system that is known to work.
  203. dnl Gustavo says it works on linuxaout, too. We'll try this later.
  204.  
  205. if [[ "$CC" = "gcc" ]]; then
  206.   dnl strength-reduce is turned off not because of paranoia, but because it
  207.   dnl actually makes the code worse in some cases on the i386 (generates too
  208.   dnl many registers, which all end up on the stack).
  209.   CFLAGS="-O3 -fomit-frame-pointer -Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes -fno-strength-reduce"
  210.   AC_MSG_CHECKING(whether we are on a Linux/i386 ELF system)
  211.   LINUXELF=n
  212.   if MACHINE=`uname -a 2>/dev/null`; then
  213.     cat >conftest.c << EOF
  214. int main() { return 0; }
  215. EOF
  216.     case $MACHINE in
  217.     Linux*i*86)
  218.       gcc conftest.c -o conftest
  219.       file conftest >conftest.file
  220.       if grep ELF conftest.file >/dev/null; then
  221.         LINUXELF=y
  222.       fi
  223.       ;;
  224.     esac
  225.     rm -f conftest*
  226.   fi
  227.   if [[ $LINUXELF = "n" ]]; then
  228.     AC_MSG_RESULT(no)
  229.   else
  230.     AC_MSG_RESULT(yes)
  231.     ASMOBJS=X86.o
  232.     CPUOBJS="cpu_fast0.o cpu_fast1.o cpu_fast2.o cpu_fast3.o cpu_fast4.o cpu_fast5.o cpu_fast6.o cpu_fast7.o cpu_fast8.o cpu_fast9.o cpu_fastA.o cpu_fastB.o cpu_fastC.o cpu_fastD.o cpu_fastE.o cpu_fastF.o"
  233.     CFLAGS="$CFLAGS -DX86_ASSEMBLY"
  234.   fi
  235. else
  236.   echo "Couldn't find GCC. UAE may or may not compile and run correctly."
  237. fi
  238.  
  239. if [[ $TARGET = "x11" -o $TARGET = "svgalib" ]]; then
  240.   dnl On a Unix system, zfile is supposed to work. Dunno about others.
  241.   CFLAGS="$CFLAGS -DUSE_ZFILE"
  242. fi
  243.  
  244. AC_SUBST(ac_cv_c_inline)
  245. AC_SUBST(STATFS_NO_ARGS)
  246. AC_SUBST(BROKEN_JOYSTICK_H)
  247. AC_SUBST(STATBUF_BAVAIL)
  248. AC_SUBST(LIBRARIES)
  249. AC_SUBST(TARGET)
  250. AC_SUBST(GFXOBJS)
  251. AC_SUBST(ASMOBJS)
  252. AC_SUBST(CPUOBJS)
  253. AC_SUBST(SET_MAKE)
  254.  
  255. AC_OUTPUT(src/Makefile Makefile)
  256.